<cfparam name="view" default="scholarWelcome" />
<cfparam name="action" default="" />
<cfparam name="j_username" default="" />
<cfparam name="Email" default="" />
<cfparam name="Claim_ID" default="" />
<cfinclude template="/assets/calgrants/ui/controller.cfm" />
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Cash for College Scholars</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta name="description" content="Cash for College Scholars">
	<meta name="author" content="Syntric">
	<cfoutput>
		<link href="#request.pathToBootstrapCSS#" rel="stylesheet" />
		<!--- <link href="/assets/bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet"> --->
		<link href="#request.pathToKendoCommonCSS#" rel="stylesheet" />
		<link href="#request.pathToKendoDefaultCSS#" rel="stylesheet" />
		<link href="#request.pathToUI#/common.css" rel="stylesheet" />
		<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800" rel="stylesheet" type="text/css" />
		<!--- <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet"> --->
		<script src="#request.pathToJQuery#" type="text/javascript"></script>
		<script src="#request.pathToBootstrap#" type="text/javascript"></script>
		<script src="#request.pathToKendo#" type="text/javascript"></script>
		<script src="#request.pathToUI#/common.js" type="text/javascript"></script>
		<script type="text/javascript">
			<cfif ArrayLen(request.alerts) gt 0>
				<cfloop index="i" from="1" to="#ArrayLen(request.alerts)#">
					alert("#request.alerts[i]#");
				</cfloop>
			</cfif>
			var toggleForgotPassword = function() {
				$("##loginContainer").hide();
				$("##forgotPasswordContainer").show();
			}
			var toggleLogin = function() {
				$("##forgotPasswordContainer").hide();
				$("##loginContainer").show();
			}
		</script>
	</cfoutput>
	<style>
		body {
			font-family: "Open Sans", "Helvetica Neue", Helvetica, Myriad, Arial, sans-serif;
			background-color: #54b1cd;
		}
	</style>
</head>
<body>
	<cfoutput>
		<div id="page" class="container">
			<div class="row">
				<div class="span12">&nbsp;</div>
			</div>
			<div class="row">
				<div class="span12">
					<img src="common/images/Cash_for_College_logo.gif" width="204" height="54" style="margin-bottom: 20px;">
					<!--- <<p><strong>Scholarship Site</strong></p>
					a href="?view=scholarWelcome"><img src="common/images/Cash_for_College_logo.gif" width="204" height="54" border="0"></a> --->
				</div>
			</div>
			<div class="row">
				<!--- timeline --->
				<div id="timeline" style="background-image: url('common/images/timeline.png'); width: 960px; height: 15px; border: 0;"></div>
			</div>
			<div class="row">
				<div class="banner prepare-banner">
					<div class="banner-text">
						<span class="banner-header">Scholar Site</span><br />
						<!--- <span class="banner-subheader"></span> --->
					</div>
				</div>
			</div>
			<div class="row" style="height: 30px;">
				<div class="span12">&nbsp;</div>
			</div>
			<cfif IsUserLoggedIn()>
				<div class="row">
					<div class="span12">
						<cfoutput>
							<ul class="breadcrumb" style="margin-right: 30px; border: 1px solid ##e3e3e3; background-color: white; font-size: 1.2em;">
								<li><cfif view eq "scholarWelcome"><strong></cfif>Welcome<cfif view eq "scholarWelcome"></strong></cfif> <span class="divider">&raquo;</span></li>
								<li><cfif view eq "editScholarProfile"><strong></cfif>Profile<cfif view eq "editScholarProfile"></strong></cfif> <span class="divider">&raquo;</span></li>
								<li><cfif view eq "editScholarInstitution"><strong></cfif>College/University<cfif view eq "editScholarInstitution"></strong></cfif> <span class="divider">&raquo;</span></li>
								<li><cfif view eq "editScholarBanking"><strong></cfif>Banking Info<cfif view eq "editScholarBanking"></strong></cfif> <span class="divider">&raquo;</span></li>
								<li><cfif view eq "editScholarAuthorization"><strong></cfif>Authorization &amp; Volunteering<cfif view eq "editScholarAuthorization"></strong></cfif> <span class="divider">&raquo;</span></li>
								<li><cfif view eq "scholarshipClaimed"><strong></cfif>Claimed!<cfif view eq "scholarshipClaimed"></strong></cfif></li>
							</ul>
						</cfoutput>
					</div>
				</div>
				<cftry>
					<!--- interface --->
					<cfinclude template="#request.pathToUI#/interfaces/#view#.cfm">
					<cfcatch type="missinginclude">
						<div class="row">
							<div class="span12">
								<div style="margin-right: 30px; margin-bottom: 40px;">
									<h3>Page Not Found</h3>
									<p>The page you have requested could not be found.</p>
								</div>
							</div>
						</div>
					</cfcatch>
				</cftry>
			<cfelse>
				<!--- login --->
				<div class="row">
					<div class="span6">
						<div class="well well-large" style="min-height: 320px; margin-right: 20px; background-color: ##fff; margin-top: 20px;">
							<h3>Claim Your Scholarship</h3>
							<p>Claim your scholarship with the Claim ID in your Cash for College Scholarship Award Letter.</p>
							<div class="alert alert-success" style="margin-bottom: 28px;">The claim deadline is <strong>August 3, #Year(Now())#</strong>!</div>
							<cfform id="claimForm" action="#script_name#" method="post" style="margin-bottom: 30px;">
								<div class="clearfix">
									<label for="name">Claim ID</label>
									<cfinput name="Claim_ID" id="Claim_ID"  type="text" value="" class="input-block-level" required="true" message="Claim ID is required" />
								</div>
								<div class="clearfix">
									<button name="claimButton" id="claimButton"  type="submit" class="btn btn-success">Claim</button>
								</div>
							</cfform>
							<p><a href="http://www.calgrants.org/documents/2015_Cash_for_College_Scholarship_FAQs.pdf" target="_blank"><img src="/applications/workshops/common/icons/pdf_32.png" alt="" width="20" height="20" border="0" style="margin-right: 8px;" />2015 Cash for College Scholarship FAQs</a></p>
						</div>
					</div>
					<div class="span6">
						<div class="well well-large" style="min-height: 320px; margin-right: 20px; background-color: ##fff; margin-top: 20px;">
							<div id="loginContainer">
								<h3>Login To Your Account</h3>
								<p>Already claimed? Login to manage your profile and track your scholarship payments.</p>
								<cfform id="loginForm" action="#script_name#" method="post" style="margin-bottom: 30px;">
									<div class="clearfix">
										<label for="name">Email</label>
										<cfinput name="j_username" id="j_username" type="text" value="#j_username#" class="input-block-level" required="true" message="Email is required" />
									</div>
									<div class="clearfix">
										<label for="password">Password</label>
										<cfinput name="j_password" id="j_password" type="password" value="" class="input-block-level" required="true" message="Password is required" />
									</div>
									<div class="clearfix">
										<button name="loginButton" id="loginButton" type="submit" class="btn btn-success">Login</button>
									</div>
								</cfform>
								<!--- <div class="alert alert-success" style="margin-bottom: 28px;">We are making a few changes to the Scholar Site. Check back soon.</div> --->
								<p><a href="##" onClick="toggleForgotPassword(); return false;">Forgot your password?</a></p>
							</div>
							<div id="forgotPasswordContainer" style="display: none; background-color: ##fff;">
								<h3>Retrieve Your Password</h3>
								<p>Enter your email address and we'll send your password.</p>
								<cfform id="passwordForm" action="#script_name#" method="post" style="margin-bottom: 30px;">
									<cfinput type="hidden" name="action" value="emailScholarPassword" />
									<div class="clearfix">
										<label for="name">Email</label>
										<cfinput type="text" name="Email" value="#email#" class="input-block-level" required="yes" message="Email is required" />
									</div>
									<div class="clearfix">
										<button type="submit" name="passwordButton" class="btn btn-success">Send</button>
									</div>
								</cfform>
								<p><a href="##" onClick="toggleLogin(); return false;">Cancel</a></p>
							</div>
						</div>
					</div>
				</div>
			</cfif>
			<div class="row body-row">
				<div class="span12">
					<div style="padding: 20px 20px 100px 20px;">
						<small>
							<p><strong>Cash for College</strong> is California's public-private partnership FAFSA completion program administered by the California Student Aid Commission and its regional and local partners.</p>
							<p><strong>Our mission</strong> is to assist high school seniors and recent graduates who are low income or first generation students in accessing as much financial aid as possible. California Cash for College puts California Dreams into Action by helping students complete the Free Application for Federal Student Aid (FAFSA) or California Dream Act Application. Students who apply for financial aid take action to enroll into education beyond high school.</p>
						</small>
					</div>
				</div>
			</div>
		</div>
	</cfoutput>
</body>
</html>
<!--- <cfswitch expression="#view#">
			<cfcase value="welcome">
				
			</cfcase>
			<cfcase value="profile">
				<cfinclude template="/assets/calgrants/ui/interfaces/editScholarProfile.cfm" />
			</cfcase>
			<cfcase value="institution">
				<cfinclude template="/assets/calgrants/ui/interfaces/editScholarInstitution.cfm" />
			</cfcase>
			<cfcase value="banking">
				<cfinclude template="/assets/calgrants/ui/interfaces/editScholarBanking.cfm" />
			</cfcase>
			<cfcase value="authorization">
				<cfinclude template="/assets/calgrants/ui/interfaces/editScholarAuthorization.cfm" />
			</cfcase>
			<cfcase value="claimed">
				<cfinclude template="/assets/calgrants/ui/interfaces/scholarClaimed.cfm" />
			</cfcase>
			<cfcase value="notClaimed">
				<cfinclude template="/assets/calgrants/ui/interfaces/scholarNotClaimed.cfm" />
			</cfcase>
			<!--- welcome --->
			<cfdefaultcase>
				<cfinclude template="/assets/calgrants/ui/interfaces/scholarWelcome.cfm" />
			</cfdefaultcase>
		</cfswitch> --->
<!--- <div class="container-fluid">
	<div class="row-fluid body-row">
		<div class="span6 offset3">
			<div style="margin-top: 20px; padding: 0 20px 0 20px;">
				<small>
					<p><strong>Cash for College</strong> is California's public-private partnership FAFSA completion program administered by the California Student Aid Commission and its regional and local partners.</p>
					<p><strong>Our mission</strong> is to assist high school seniors and recent graduates who are low income or first generation students in accessing as much financial aid as possible. California Cash for College puts California Dreams into Action by helping students complete the Free Application for Federal Student Aid (FAFSA) or California Dream Act Application. Students who apply for financial aid take action to enroll into education beyond high school.</p>
				</small>
			</div>
		</div>
	</div>
</div> --->
<!--- <p>#Claim_ID#</p>
<p>#GetAuthUser()# - #GetUserRoles()#</p>
<cfdump var="#request#" expand="no" label="request"> --->
<!--- <cfscript>
	base = new assets.calgrants.com.Base();
	scholarshipGateway = new assets.calgrants.com.gateway.ScholarshipGateway();
	storedProcedureGateway = new assets.calgrants.com.gateway.StoredProcedureGateway();
	switch(action) {
		/*
		case "validateClaim":
			if (IsDefined("Claim_ID") and Len(Trim(Claim_ID)) gt 7) {
				qScholarship = storedProcedureGateway.call(sp = "validateClaim", Claim_ID = Claim_ID);
				currentCohort = base.getCurrentCohort();
				if (qScholarship.RecordCount neq 1 OR qScholarship.Cohort neq currentCohort) {
					ArrayAppend(request.alerts, "Invalid Claim\n\nVerify the Claim ID from your scholarship award letter.");
					view = "login";
				} else if (qScholarship.RecordCount eq 1 and qScholarship.Cohort eq currentCohort) {
					view = "editScholarProfile";
				}
			}
		break;
		*/
		case "saveScholarProfile":
			view = "editScholarInstitution";
		break;
		case "saveScholarInstitution":
			view = "editScholarBanking";
		break;
		case "saveScholarBanking":
			view = "editScholarAuthorization";
		break;
		case "saveScholarAuthorization":
			view = "scholarClaimed";
		break;
		case "emailScholarPassword":
			ArrayAppend(request.alerts, "Email sent");
		break;
		default:
			view = "login";
	}
</cfscript> --->
<!--- <cfparam name="view" default="login" />
<cfparam name="action" default="" />
<cfparam name="error" default="" />
<cfparam name="email" default="" />
<cfparam name="Claim_ID" default="" />
<cfparam name="j_username" default="" />
<cfinclude template="#request.pathToUI#/controller.cfm"> --->
<!--- <cfif IsDefined("Claim_ID") and Len(Trim(Claim_ID)) gt 6>
	<cfscript>
		var scholarshipGateway = new assets.calgrants.com.gateway.ScholarshipGateway();
		var currentCohort = storedProcedureGateway.call("getCurrentCohort");
		var cScholarship = scholarshipGateway.query(Claim_ID = Claim_ID, Deleted = IIf(currentCohort.currentCohort eq 7, DE(""), DE(false)));
		var qScholarship = scholarshipGateway.query(Student_ID = cScholarship.Student_ID, Deleted = 0);
		// failed claim
		if (qScholarship.RecordCount eq 0) {
			ArrayAppend(request.alerts, "Invalid Claim ID\n\nVerify the Claim ID from your scholarship award letter.\n\nIf you continue to get this message, contact #request.personality.name# at #request.personality.email#.");
		// duplicate Claim IDs
		} else if (qScholarship.RecordCount gt 1) {
			ArrayAppend(request.alerts, "Duplicate Claim ID\n\nMore than one account exists for Claim ID \""" & Claim_ID & "\"". Contact #request.personality.name# at #request.personality.email# for assistance resolving this issue.");
		// valid Claim ID
		} else if (qScholarship.RecordCount eq 1) {
			// already claimed, should login instead
			if (IsDate(qScholarship.Claim_Date)) {
				ArrayAppend(request.alerts, "Scholarship Claimed\n\nScholarship \""" & Claim_ID & "\"" has been claimed. Login with the Email and Password entered during claiming.\n\nTo retrieve a forgotten password, select \""Forgot your password\?\"" link underneath the login form.");
			// scholarship expired unclaimed
			} else if (qScholarship.Cohort lt currentCohort.currentCohort) {
				ArrayAppend(request.alerts, "Scholarship Expired\n\nThe claiming deadline for scholarship " & Claim_ID & " has passed.");
			// Claim ID valid, begin claim process
			} else {
				var authScholar = scholarshipGateway.get(Scholarship_ID = qScholarship.Scholarship_ID);
				StructAppend(request.authScholar, authScholar);
				request.authScholar.lastVisit = Now();
				view = "scholarWelcome";
				//ArrayAppend(request.alerts, "Valid Claim");
			}
		} else {
			ArrayAppend(request.alerts, "Undetermined Error\n\nPlease try again.");
		}
	</cfscript>
</cfif> --->
<!--- <cftry>
				<cfinclude template="#request.pathToUI#/interfaces/#view#.cfm">
				<cfcatch type="missinginclude">
					<div class="row">
						<div class="span6">
							<div class="well well-large" style="height: 320px;">
								<h3>Claim Your Scholarship</h3>
								<p>Claim your scholarship with the Claim ID in your Cash for College Scholarship Award Letter.</p>
								<div class="alert alert-error" style="margin-bottom: 10px;">The claim deadline is August 3, #Year(Now())#!</div>
								<cfform id="claimForm" action="#script_name#" method="post" style="margin-bottom: 20px;">
									<div class="clearfix">
										<label for="name">Claim ID</label>
										<cfinput name="Claim_ID" id="Claim_ID"  type="text" value="" class="input-block-level" required="true" message="Claim ID is required" />
									</div>
									<div class="clearfix">
										<button name="claimButton" id="claimButton"  type="submit" class="btn btn-primary" style="width: 40%;">Claim Scholarship</button>
									</div>
								</cfform>
								<p><a href="http://www.calgrants.org/documents/2015_Cash_for_College_Scholarship_FAQs.pdf" target="_blank"><img src="/applications/workshops/common/icons/pdf_32.png" alt="" width="32" height="32" border="0" style="margin-right: 8px;" />2015 Cash for College Scholarship FAQs</a></p>
							</div>
						</div>
						<div class="span6">
							<div class="well well-large" style="height: 320px;">
								<div id="loginContainer">
									<h3>Login To Your Account</h3>
									<p>Already claimed? Login to manage your profile and track your scholarship payments.</p>
									<cfif cgi.REMOTE_ADDR eq "190.148.113.156">
										<cfform id="loginForm" action="#script_name#" method="post" style="margin-bottom: 20px;">
											<div class="clearfix">
												<label for="name">Email</label>
												<cfinput name="j_username" id="j_username" type="text" value="#j_username#" class="input-block-level" required="true" message="Email is required" />
											</div>
											<div class="clearfix">
												<label for="password">Password</label>
												<cfinput name="j_password" id="j_password" type="password" value="" class="input-block-level" required="true" message="Password is required" />
											</div>
											<div class="clearfix">
												<button name="loginButton" id="loginButton" type="submit" class="btn btn-primary" style="width: 40%;">Login</button>
											</div>
										</cfform>
										<p><a href="##" onClick="toggleForgotPassword(); return false;">Forgot your password?</a></p>
									<cfelse>
										<div class="alert alert-info">Hold on!  We are making some quick changes.</div>
									</cfif>
								</div>
								<div id="forgotPasswordContainer" style="display: none;">
									<h3>Retrieve Your Password</h3>
									<p>Enter your email address and your password will be sent to you.</p>
									<cfform id="passwordForm" action="#script_name#" method="post" style="margin-bottom: 20px;">
										<cfinput type="hidden" name="action" value="emailScholarPassword">
										<div class="clearfix">
											<label for="name">Email</label>
											<cfinput type="text" name="email" value="#email#" class="input-block-level" required="yes" message="Email is required" />
										</div>
										<div class="clearfix">
											<button type="submit" name="passwordButton" class="btn btn-primary" style="width: 40%;">Send Password</button>
										</div>
									</cfform>
									<p><a href="##" onClick="toggleLogin(); return false;">Cancel</a></p>
								</div>
							</div>
						</div>
					</div>
					<div class="row">
						<div class="span12">
							<div class="well well-framed">
								<p>Need help? Email #request.payment.name# at <a href="mailto:#request.payment.email#">#request.payment.email#</a>.</p>
								<p style="margin-bottom: 0;">Please include your name, college/university and Claim ID in your message.</p>
							</div>
						</div>
					</div>
				</cfcatch>
			</cftry> --->